home *** CD-ROM | disk | FTP | other *** search
- //******** Listing 4 ********************** OBJECT.HPP ***
- // A simple class to announce construction and destruction
- // (c) C Gazette. See listing 1 for usage.
- //********************************************************
-
- #ifndef OBJECT_HPP_
- #define OBJECT_HPP_
- #include <stdio.h>
-
- class object {
- char tag; // to indicate which object this is
- public:
- object(char tg = '-') : tag(tg) {
- printf("creating %c\n", tag);
- }
- void print() { printf("object %c\n", tag); }
- ~object() {
- printf("destroying %c\n", tag);
- }
- };
-
- #endif // OBJECT_HPP_